<?php
/**
 * XmuSlh, web platform of Student Association Federation of Xiamen University
 * 
 * Rewritting one or some pages of StatusNet. 
 * To get the original version, please visit <http://status.net/>.
 * 
 * StatusNet, the distributed open-source microblogging tool
 * 
 * LICENCE: This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * Addphotoset action form.
 * 添加相册的表格.
 * 
 * @author		ytukie <ytukie@gmail.com>
 * @version		0.1
 */

// XmuSlh only.
if ( !defined('XMUSLH')) { exit(1); }

// Requirements.
require_once INSTALLDIR . '/lib/slh_form.php';

class AddphotosetForm extends Form
{
	/**
	 * ID of the from
	 */
	function id()
	{
		return 'id_form_addphotoset';
	}
	
	/**
	 * Class of the form.
	 */
	/*
	function formClass()
	{
	}
	*/
	
	/**
	 * Action of the form
	 * 
	 * Return the string URL of the action.
	 */
	function action()
	{
		return slh_action2url('choosephotoset');
	}
	
	/**
	 * Name of the form
	 */
	function formLegend()
	{
		$this->out->element('legend', null, 'add photo set');
	}
	
	/**
	 * Token of the form.
	 */
	function formToken()
	{
		$this->out->hidden('formtoken', 'addphotoset');
	}
	
	/**
	 * Data elements.
	 */
	function formData()
	{
		$this->out->elementStart('dl', array('class' => 'cls_dl_form'));
		
		$this->out->element('dt', null, '添加新的相册');
		$this->out->elementStart('dd');
		$this->out->elementStart('ul');
			$this->out->elementStart('li');
			$this->out->input('title',
							  '相册名称',
							  $this->getField('title'),
							  '相册的名称呃.');
			$this->out->elementEnd('li');
			
			$this->out->elementStart('li');
			$this->out->textarea('message',
								 '相册简介',
								 3,
								 60,
								 $this->getField('message'),
								 '[选填]简单说明下这个相册的主要内容哈.');
			$this->out->elementEnd('li');
		$this->out->elementEnd('ul');
		$this->out->elementEnd('dd');
		
		$this->out->elementEnd('dl');
	}
	
	/**
	 * Action elements.
	 */
	function formActions()
	{
		$this->out->elementStart('div', 'formaction');
		$this->out->submit('submit',
						   '添加',
						   'submit',
						   'add',
						   '添加一个相册.');
		$this->out->elementEnd('div');
	}
}